#include<func.h>
//测试加锁，第二次加锁时返回错误码
int main()
{
    pthread_mutex_t mutex;
    int ret=pthread_mutex_init(&mutex,NULL);//初始化锁
    THREAD_ERR_CHECK(ret,"pthread_mutex_init");
    ret=pthread_mutex_lock(&mutex);//第一次加锁
    THREAD_ERR_CHECK(ret,"pthread_mutex_lock");
    ret=pthread_mutex_trylock(&mutex);//第二次测试加锁
    THREAD_ERR_CHECK(ret,"pthread_mutex_tylock");
    return 0;
}